using System.ComponentModel;
using System.Runtime.CompilerServices;
using Material.Icons;
using Prism.Navigation;

namespace JMClient.Models.Common;

public class NavigationItem : NavigationParameters,INotifyPropertyChanged
{
   private string _title;
   private MaterialIconKind _icon;
   private bool _isSelected;
   private bool _isVisible = true;

   public string Id { get; set; }
            
   public string Title
   {
      get => _title;
      set
      {
         if (_title != value)
         {
            _title = value;
            OnPropertyChanged();
         }
      }
   }
            
   public MaterialIconKind Icon
   {
      get => _icon;
      set
      {
         if (_icon != value)
         {
            _icon = value;
            OnPropertyChanged();
         }
      }
   }
            
   public bool IsSelected
   {
      get => _isSelected;
      set
      {
         if (_isSelected != value)
         {
            _isSelected = value;
            OnPropertyChanged();
         }
      }
   }
            
   public bool IsVisible
   {
      get => _isVisible;
      set
      {
         if (_isVisible != value)
         {
            _isVisible = value;
            OnPropertyChanged();
         }
      }
   }

   public event PropertyChangedEventHandler PropertyChanged;
            
   protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
   {
      PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
   }
}
public class NavigationParameter:NavigationParameters
{
   
   public NavigationParameter(string title,Material.Icons.Avalonia.MaterialIcon icon,string viewname)
   {
      Add("Title",title);
      Add("Icon",icon);
      Add("ViewName",viewname);
   }
}